package o2o.dao.PO.order;

import java.util.HashSet;
import java.util.Set;

//订单状态信息
public class ORDER_STATUS {
    public final static int SUBMIT = 1; //用户提交订单
    public final static int PAYED = 2; //订单已支付,待配送
    public final static int CANCEL = 3; //用户未支付取消订单
    public final static int CANCEL_BY_SYSTEM = 41; //超时未支付 系统取消订单
    public final static int PAYED_CANCEL = 4; //用户已支付取消订单
    public final static int PAYED_APPLY_CANCEL = 71; //用户已支付申请取消订单

    public final static int PAYED_APPLY_PART_CANCEL = 81; //用户申请部分商品退款
    public final static int PAYED_PASS_PART_CANCEL = 82; //部分申请退款通过
    public final static int PAYED_REFUND_PART_CANCEL = 83; //部分申请退款未通过


    // CREATE BY yangtk 2018/10/22
    public final static int UNDERLINE_SUBMIT = 11; // 提交线下订单 (老哥外卖在用)

    public final static int ARRIVE_PAY = 22; // 用户使用货到付款

    public final static int SHOP_SURE = 5; //商户接单
    public final static int SHOP_REFUSED = 6; //商户拒绝接单
    public final static int SHOP_FINISH = 29; //店铺确认消费
    public final static int SHOP_READY = 23; //店铺备货完成

    public final static int SHOP_PUSH_GOODS = 51; //商家已确认发货
    public final static int POSTMAN_PULL_GOODS = 61; //配送员已取货

    public final static int SHOP_SELECT = 45; //新订单（好管家）
    public final static int WAIT_REPAIR = 48; //用户已选择商家
    public final static int WORKER_SURE = 54; //工人已确认接单
    public final static int REPAIR_DONE = 63; //工人已完成维修
    public final static int USER_SURED = 64; //用户确认完成
    public final static int PAY_CONFIRM = 65; //订单已支付成功

    public final static int POSTMAN_DAODIAN = 21; //配送员已到店
    public final static int PEISONG = 7; //配送员已取货，配送货物路上
    public final static int POSTMAN_SURE_BEFORE_SHOP = 72; //配送员抢单，商家未接单
    public final static int POSTMAN_ZHIDING = 13; //已指定配送员
//    public final static int POSTMAN_ZHIDING_BEFORE_SHOP = 73; //已指定配送员，商家未接单
    public final static int POSTMAN_SURE = 8; // 配送抢单、接单
    public final static int POSTMAN_ZD_SURE_BEFORE_SHOP = 78; //指定的骑手接单，商家未接单
    public final static int POSTMAN_REFUSED = 16; //配送拒绝接单
    public final static int POSTMAN_FINISH = 19; //配送员确定送达
    public final static int POSTMAN_CANT_FINISH = 33; //无法送达
    public final static int POSTMAN_CANT_FINISH_BACK = 34;//无法送达，已经遣返
    public final static int OVER = 9; //订单完成

    public final static int POSTMAN_ARRIVED = 77;       // 司机到达指定位置,等待乘客上车
    public final static int POSTMAN_RECEIVING_PASSENGER = 79;   // 司机接到乘客,正赶往目的地


    public final static int POSTMAN_PICK_POINT = 55; // 送达提货点
    public final static int SECONDARY_POSTMAN_SURE_AFTER_P_SUER = 56; // 众包端已抢单(众包端已抢单)
    public final static int SECONDARY_POSTMAN_PULL_GOODS = 57; // 众包端已取货
    public final static int SECONDARY_POSTMAN_SURE_AFTER_P_DAODIAN = 58; // 众包端已抢单
    public final static int SECONDARY_POSTMAN_SURE_AFTER_P_PULL = 59; // 众包端已抢单
    public final static int SECONDARY_POSTMAN_SURE_AFTER_P_POINT = 60; // 众包端已抢单
    public final static int SECONDARY_POSTMAN_SURE_AFTER_INNER_SHOP = 66; // 二级骑手抢单(二级骑手抢校内商家订单)


    public static Set<Integer> finishDeliverSet = new HashSet<>();          // 配送完成涉及的状态列表
    public static Set<Integer> userWaitForPickSet = new HashSet<>();    // 待取货列表
    public static Set<Integer> userWaitForPostSet = new HashSet<>();        // 待配送
    public static Set<Integer> userOrderCancelSet = new HashSet<>();         // 已取消

    static {
        finishDeliverSet.add(ORDER_STATUS.OVER);
        finishDeliverSet.add(ORDER_STATUS.POSTMAN_FINISH);
        finishDeliverSet.add(ORDER_STATUS.USER_SURED);

        // 待取货列表
        userWaitForPickSet.add(PAYED);
        userWaitForPickSet.add(SHOP_SURE);
        userWaitForPickSet.add(SHOP_READY);
        userWaitForPickSet.add(POSTMAN_DAODIAN);
        userWaitForPickSet.add(POSTMAN_SURE_BEFORE_SHOP);
        userWaitForPickSet.add(POSTMAN_ZHIDING);
        userWaitForPickSet.add(POSTMAN_SURE);
        userWaitForPickSet.add(POSTMAN_ZD_SURE_BEFORE_SHOP);
        userWaitForPickSet.add(POSTMAN_REFUSED);
        userWaitForPickSet.add(SECONDARY_POSTMAN_SURE_AFTER_P_SUER);
        userWaitForPickSet.add(SECONDARY_POSTMAN_SURE_AFTER_P_DAODIAN);
        userWaitForPickSet.add(SECONDARY_POSTMAN_SURE_AFTER_INNER_SHOP);

        // 待配送的
        userWaitForPostSet.add(SHOP_PUSH_GOODS);
        userWaitForPostSet.add(POSTMAN_PULL_GOODS);
        userWaitForPostSet.add(POSTMAN_PICK_POINT);
        userWaitForPostSet.add(PEISONG);
        userWaitForPostSet.add(POSTMAN_FINISH);
        userWaitForPostSet.add(SHOP_FINISH);
        userWaitForPostSet.add(SECONDARY_POSTMAN_PULL_GOODS);

        // 用户已取消订单
        userOrderCancelSet.add(CANCEL);
        userOrderCancelSet.add(CANCEL_BY_SYSTEM);
        userOrderCancelSet.add(PAYED_CANCEL);
    }
}
